<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/7/3
 * Time: 21:18
 */

//加载GatewayClient。关于GatewayClient参见本页面底部介绍
require_once '../../../GatewayWorker/GatewayClient/Gateway.php';
// GatewayClient 3.0.0版本开始要使用命名空间
use GatewayClient\Gateway;
// 设置GatewayWorker服务的Register服务ip和端口，请根据实际情况改成实际值(ip不能是0.0.0.0)
Gateway::$registerAddress = '127.0.0.1:1238';

// 假设用户已经登录，用户uid和群组id在session中
$uid      = $_SESSION['uid'];
$shop_id  = $_SESSION['shop_id'];
// client_id与uid绑定
Gateway::bindUid($client_id, $shop_id);